<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="../css/bootstrap.min.css" />
	<script type="text/javascript" src="../js/jquery.js"></script>
	<script type="text/javascript" src="../js/bootstrap-dropdown.js"></script>
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
	<script type="text/javascript" src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
	<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection">
	<!--[if IE]>
	  <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection">
	<![endif]-->
	<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection">
	<link href="../css/application-766336123a9b61bedf26182718c02860.css" media="all" rel="stylesheet" type="text/css">
	<script type="text/javascript" async="" src="../js/ga.js"></script><script src="../js/application-e8369d8531953caeeedd0118548cdc1c.js" type="text/javascript"></script>
	<style type="text/css">
		body{
			margin-top:50px;
		}
		input,
		.page-header{
			background-color:rgb(240, 245, 248);
		}
		
		#beijing{
			width:400px;
			height:100px;
		}
		
		#telsort{
			display : inline;
		}
	</style>
	
</head>
<body>
	<div class="navbar navbar-fixed-top">
	  <div class="navbar-inner">
		<div class="container">
			<a class="brand" href="home.action"><img alt="Workxp-logo" src="../img/workxp-logo-68b281b82e899ff436ecf42ebcc1bc58.png"></a>
			<ul class="nav">
			  <li>
				<a href="../main.action">最新动态</a>
			  </li>
			  <li><a href="list.action">联系人</a></li>
			  <li><a href="../task/task.action">任务</a></li>
			  <li><a href="../deal/list.action">机会</a></li>
			  <li class="dropdown" id="menutest1">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#menutest1">
				  添加
				  <b class="caret"></b>
				</a>
				<ul class="dropdown-menu">
				  <li><a href="#"><i class="icon-user"></i>&nbsp;联系人</a></li>
				  <li><a href="addcompany.action"><i class="icon-home"></i>&nbsp;公司</a></li>
				  <li class="divider"></li>
				  <li><a href="../task/addtask.action"><i class="icon-ok"></i>&nbsp;任务</a></li>
				  <li><a href="../deal/adddeal.action"><i class="icon-star-empty"></i>&nbsp;机会</a></li>
				</ul>
			  </li>
			  
			</ul>
			<form class="navbar-search pull-left">
			  <input type="text" class="search-query" placeholder="搜索联系人或机会...">
			</form>
			
			<ul class="nav pull-right" >
			  <li>
				<a href="#">${user.username }</a>
			  </li>
			  <li class="dropdown" id="menutest2">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#menutest2">
				  管理
				  <b class="caret"></b>
				</a>
				<ul class="dropdown-menu">
				  <li><a href="#"><i class="icon-user"></i>&nbsp;同事</a></li>
				  <li><a href="#"><i class="icon-list-alt"></i>&nbsp;组</a></li>
				  <li class="divider"></li>
				  <li><a href="#"><i class="icon-asterisk"></i>&nbsp;账号</a></li>
				</ul>
			  </li>
			  <li class="divider-vertical"></li>
			  <li><a href="../logout.action">退出</a></li>
			</ul>
			
		</div>
	  </div>
	</div>
	
	<div class="container">
		
			<div class="row">
				  <div class="span2"></div>
				  <div class="span8">
					
						<div class="page-header well">
							<c:choose>
									<c:when test="${contact.name != null }">
									  <h2><img src="img/contact_list.png" alt="" />&nbsp;${contact.name }的信息</h2>	
									</c:when>
									<c:when test="${contacts.name == null }">
									  <h2><img src="img/contact_list.png" alt="" />&nbsp;${contact.companyname }的信息</h2>	
									</c:when>
								</c:choose>
						</div>	
						
	<div class="page-header well">
		<form id="myform" class="form-horizontal"  action="list.action?id=${contact.id }"  method="post" >
		  <fieldset>
			<legend>详细资料</legend>
			
			<c:choose>
				<c:when test="${contact.name != null }">
						<div class="control-group">
						  <label class="control-label">姓名</label>
						  <div class="controls">
							<input type="text" disabled="true" name="contact.name" value="${contact.name}">
						  </div>
						</div>
						
						<div class="control-group">
						  <label class="control-label">公司</label>
						  <div class="controls">
							<input type="text" disabled="true" name="contact.companyname" value="${ contact.companyname}">
						  </div>
						</div>
				</c:when>
				<c:when test="${contact.name == null }">
						<div class="control-group">
						  <label class="control-label">公司名</label>
						  <div class="controls">
							<input type="text" disabled="true"  name="contact.companyname"  value="${ contact.companyname}">
						  </div>
						</div>
				</c:when>
			</c:choose>
			
			
			
			<div class="control-group string optional marco_polo_container">
				<label for="person_phone" class="string optional control-label"> 电话</label>
				<div class="controls">
					<div  id="contact_phone_list_company">
							<div style="" class="contact_methods"></div>
							
							<c:forEach items="${contact.telSet }" var="tellist">
										<div style="" class="contact_methods">
										<span>
										<input type="text" disabled="true"  value="${tellist.tel }"  size="30" name="tel" id="tel" >
											<select display="inline" disabled="true" name="teltype" id="telsort" style="width:90px; margin-left:-4px" >
												<option value="">${tellist.type }</option>
											</select>
											</span>
									</div>
								</c:forEach>
							
							
							
					</div>
				</div>
			</div>
			
			
			  <div class="control-group string optional marco_polo_container">
				<label for="person_phone" class="string optional control-label">邮箱</label>
				<div class="controls">
					<div  id="addemail">
							<div style="" class="contact_methods"></div>
							
							<c:forEach items="${contact.emailSet }" var="maillist">
										<div style="" class="contact_methods">
										<span>
										<input type="text"  disabled="true" value="${maillist.email }"  size="30" name="tel" id="tel" >
											<select display="inline" disabled="true" name="teltype" id="telsort" style='width:90px; margin-left:-4px' >
												<option value="公司">${maillist.type }</option>
											</select>
											</span>
									</div>
								</c:forEach>
							
					</div>
				</div>
			</div>
			
			
			<div class="control-group string optional marco_polo_container">
				<label for="person_phone" class="string optional control-label">IM</label>
				<div class="controls">
					<div  id="addim">
							<div style="" class="contact_methods"></div>
							
							<c:forEach items="${contact.imSet }" var="maillist">
										<div style="" class="contact_methods">
										<span>
										<input type="text" disabled="true"  value="${maillist.im }"  size="30" name="tel" id="tel" >
											<select display="inline" disabled="true" name="teltype" id="telsort" style='width:90px; margin-left:-4px' >
												<option value="公司">${maillist.type }</option>
											</select>
											</span>
									</div>
								</c:forEach>
							
					</div>
				</div>
			</div>
			
			
			<div class="control-group string optional marco_polo_container">
				<label for="person_phone" class="string optional control-label">网址</label>
				<div class="controls">
					<div  id="addwebsite">
							<div style="" class="contact_methods"></div>
							
							<c:forEach items="${contact.websiteSet }" var="maillist">
										<div style="" class="contact_methods">
										<span>
										<input type="text"  disabled="true" value="${maillist.website }"  size="30" name="tel" id="tel" >
											<select display="inline" disabled="true" name="teltype" id="telsort" style='width:90px; margin-left:-4px' >
												<option value="公司">${maillist.type }</option>
											</select>
											</span>
									</div>
								</c:forEach>
							
					</div>
				</div>
			</div>
			
			
			<div class="control-group">
			  <label class="control-label">地址</label>
			  <div class="controls">
				<input type="text" disabled="true" name="contact.address" value="${contact.address }">
			  </div>
			</div>
			
			
			<div class="control-group">
			  <label class="control-label">新浪微博</label>
			  <div class="controls">
				<input type="text" disabled="true" name="contact.weibo"   value="${contact.weibo }">
				 <p >微博名称或ID</p>
			  </div> 
			</div>
			<div class="control-group">
			  <label class="control-label">背景信息</label>
			  <div class="controls">
				<textarea name="contact.content" disabled="true" id="beijing" rows="20"cols="40">${contact.content }</textarea>
				 <p >简介，如何认识的等</p>
			  </div> 
			</div>
			<div class="control-group">
			  <label class="control-label">谁可以看见？</label>
			  <div class="controls">
					
				<c:choose>
					<c:when test="${contact.view == 'all' }">
						<input class="nogroup" type="Radio" name="view" value="all"  checked>所有同事<br/>
					</c:when>
					<c:when test="${contact.view == 'me' }">
						<input class="nogroup" type="Radio" name="view" value="me" checked>只有我能看见<br/>
					</c:when>
					<c:when test="${contact.view != '' and contact.view != 'me' }">
						<input class="nogroup"  type="Radio" name="view" value="${contact.view }" checked>${contact.view }小组成员和创建者可见<br/>
					</c:when>
				</c:choose>				
				
				 
			  </div> 
			</div>
			
			<div class="control-group">
			  <label class="control-label"></label>
			  <div class="controls">
				
				<button id="button2" class="btn btn-success" type="submit">
				  返回联系列表
				</button>
				
			  </div> 
			</div>
			  
			
		  </fieldset>
		</form>					
	</div>	
						
						
						
				  </div>
				  <div class="span4">
						<div class="page-header well">
							<h3>通讯录管理</h3>
							<table class="table">
							  <tbody>
								<tr>
								  <td><img src="img/contacts.png" alt="" /><a href="addcontact.action">添加联系人</a></td>
								</tr>
								<tr>
								  <td><img src="img/company.png" alt="" /><a href="addcompany.action">添加公司</a></td>
								</tr>
								<tr>
								  <td><img src="img/company.png" alt="" /><a href="show_editcontact.action">修改联系对象</a></td>
								</tr>
								<tr>
								  <td><img src="img/company.png" alt="" /><a href="show_delcontact.action">删除联系对象</a></td>
								</tr>
								
								<tr>
								  <td><img src="../img/export_to_document.png" alt="" />
											<a  data-toggle="modal" href="#myModal" >点击导入联系人</a>
	
												<div class="modal fade" id="myModal">
												  <div class="modal-header">
													<a class="close" data-dismiss="modal"><img src="../img/closebox.png"></a>
													<h3>您的联系人文件放入C盘import文件夹中了吗？</h3>
												  </div>
													 <form novalidate="novalidate" method="post" id="user-form" class="simple_form well" action="import_contact.action" accept-charset="UTF-8"><div style="margin:0;padding:0;display:inline"><input type="hidden" value="✓" name="utf8"><input type="hidden" value="y27zJQeqxEC1a5ndwzOvNh+/zsUoKoR8yeyGZRDmpus=" name="authenticity_token"></div>
												  <div class="modal-body">
													 
														  <div class="control-group email required"><div class="controls"><input type="text" value="" size="50" placeholder="要导入的联系人文件名" name="import_name" id="user_email" class="string email required span3"></div></div>
												  </div>
												  <div class="modal-footer">
													<input name="" class="btn btn-primary" type="submit" value="导入"/>
													<a href="#" class="btn"   data-dismiss="modal">取消</a>
												  </div>
														</form>
												</div>
	
								  </td>
								</tr>
								<tr>
								  <td><img src="../img/export.png" alt="" />
								  			
								  			<a  data-toggle="modal" href="#exportModal" >点击导出联系人</a>
	
												<div class="modal fade" id="exportModal">
												  <div class="modal-header">
													<a class="close" data-dismiss="modal"><img src="../img/closebox.png"></a>
													<h3>导出的联系人文件默认存在C盘export文件夹中！</h3>
												  </div>
													 <form novalidate="novalidate" method="post" id="user-form" class="simple_form well" action="export_contact.action" accept-charset="UTF-8"><div style="margin:0;padding:0;display:inline"><input type="hidden" value="✓" name="utf8"><input type="hidden" value="y27zJQeqxEC1a5ndwzOvNh+/zsUoKoR8yeyGZRDmpus=" name="authenticity_token"></div>
												  <div class="modal-body">
													 
														  <div class="control-group email required"><div class="controls"><input type="text" value="" size="50" placeholder="请给导出的联系人文件命名" name="export_name" id="user_email" class="string email required span4" style="height:30px;"></div></div>
												  </div>
												  <div class="modal-footer">
													<input name="" class="btn btn-primary" type="submit" value="导出"/>
													<a href="#" class="btn"   data-dismiss="modal">取消</a>
												  </div>
												</form>
												</div>
								  
								  </td>
								</tr>
							  </tbody>
							</table>
						</div>	
						<input  type="button" value="${contact.name }在" id="btn" />
						<input type="text" disabled="true"  name="" id="address"  value="${contact.address }" />
						<div id="map" style="width:303px;height:338px"></div>
						
						
						
				  </div>
				</div>
			</div>
	
		
	<script type="text/javascript">
		$(document).ready(function(){
			
		
			$("#new_task").click(function(){
				$('#myModal').modal({
					backdrop:true,
					keyboard:true,
					show:false
				});
			});
		});
		var map;
	
		$(document).ready(function(){
			
			
			map = new GMaps({
					div: '#map',
					lat: 35.2193612,
					lng: 113.2482923 
			});

				GMaps.geocode({
				  address: $('#address').val(),
				  callback: function(results, status) {
					if (status == 'OK') {
					  var latlng = results[0].geometry.location;
					  map.setCenter(latlng.lat(), latlng.lng());
					  map.addMarker({
						lat: latlng.lat(),
						lng: latlng.lng()
					  });
					}
				  }
				});
			
			
			
			
			$("#new_task").click(function(){
				$('#myModal').modal({
					backdrop:true,
					keyboard:true,
					show:false
				});
			});

			
		});
		
		
	</script>
</body>
</html>